<template>
    <div class="input-out">
        <!-- icon图标放置 -->
        <div class="icon">
            <i class="iconfont" :class="props.Info.icon.length > 0 ? props.Info.icon : ''" style="font-size: 20px;"></i>
        </div>
        <div class="fenge">

        </div>
        <!-- input放置 -->
        <div class="input">
            <input @input="changeValue" v-model="state.value" :placeholder="props.Info.placeholder" :type="props.Info.name==='password'?'password':'text'">
        </div>
    </div>
</template>

<script>
import '../../../assets/iconfont/icon.css'
import { onMounted, reactive } from 'vue';
export default {
    props: ['Info'],
    setup(props, { emit }) {
        const state = reactive({
            value: ''
        })
        onMounted(() => {
            // console.log(props.Info)
            // emit('value',state.value)
            // console.log(props)
            
        })
        const changeValue = () => {
            emit('value', [props.Info.name, state.value])
        }


        

        return { state, props, changeValue }
    }
}
</script>

<style lang="less" scoped>
.input-out {
    width: 300px;
    height: 34px;
    border: 2px solid rgb(81, 81, 81);
    display: flex;
    align-items: center;
    overflow: hidden;

    .icon {
        margin-left: 4px;
        margin-right: 4px;
        color: rgb(25, 25, 25);
    }
    .fenge{
        width: 4%;
        height: 100%;
        background-color: rgba(74, 80, 85, 0.784);
    }

    .input {
        width: 88%;
        height: 100%;

        input {
            height: 100%;
            width: 100%;
            background-color: rgba(74, 80, 85, 0.784);
            border: none;
            outline: none;
            font-size:14px;
            color: #232323;
        }

        input::-webkit-input-placeholder {
            /* placeholder颜色 */
            color: #dcdcdc;
            /* placeholder字体大小 */
            font-size: 14px;
        }
    }

    // .right{
    //     .yzcode{
    //         width: 80px;
    //         height: 34px;
    //         background: #777777;
    //         position: relative;
    //         cursor: pointer;
    //         user-select: none;
    //         .yzcode-item{
    //             position: absolute;
    //         }
    //     }
    // }
}
</style>